<template>
	<view>
		<div>
			<navitop>
				<i class="iconfont" slot="left-slot" @click="outlot">&#xe667;</i>
				<span slot="center-slot"><h4>{{title}}</h4></span>
				<i  slot="right-slot" v-if="!activaty">
					<i class="iconfont icon-sousuo1" style="font-size: 25px;padding-left: 15px;" v-show="activi_alert" @click="switchs(1)"></i>
					<i class="iconfont icon-jiahao" style="font-size: 25px;padding-left: 15px;" v-show="power_alert"  @click="tapPopup" v-if="sear_alert == 0" ></i>
					<i class="iconfont icon-jiahao" style="font-size: 25px;padding-left: 15px;" v-show="power_alert" v-else @click="searAlert"></i>
				</i>
			</navitop> 
		</div>
	
		<div :style="'margin-top:' + nv_height" class="second_fliex"> 
			<div class="second_serch" v-if="search_type">
				<div :class="search_all_class" @click="search_class_all()">
					所有
				</div>
				<div :class="search_id == item.id ? search_class : ''" v-for="(item,index) in Search_prog" @click="search_clas(item)">
						{{item.searchName}}
				</div>
			</div>
		</div>
		<!-- 内容 -->
				<div class="second_list_solt" style="margin-top:140px">
					<!-- 客户列表 -->
					<div  v-show="showListone" class="customer_width" v-for="(item,index) in dataSorce" >
						<div class="customer_list">
							<div class="collect_left" @click="detials(item.id)">
								<div class="second_list_time" v-show="item.crmName ? true :false">
									<text>{{item.crmName}}</text>
								</div>
								<div class="second_list_time" v-show="item.lastTouchDate ? true :false" style="font-size: 14px;">
									最后联系日期：<text>{{ item.lastTouchDate ? item.lastTouchDate.substr(0,10):item.lastTouchDate}}</text>
								</div>
								<div class="second_list_time" v-show="item.lastTouchSummary ? true :false">
									<text>{{item.lastTouchSummary}}</text>
								</div>
							</div>
							 <!-- 关注 -->
							<div  :class="item.collectId ? 'collect_right_c' : 'collect_right'" @click="collect_on(item)">
								<div class="second_list_citi" >
									 <i :class="item.collectId ? 'iconfont icon-jiaxingshoucangtianchong' : 'iconfont icon-shoucang-xianxing'"></i>
								</div>
							</div>
						</div>
					</div>
					
					<!-- 跟进记录 -->
					<div v-if="showList">
						<secod v-if="loading" :dataSor="dataSorce" @detia='detia'></secod>
					</div>
					
					<!-- 联系人 -->
					<view class="customer_width ">
						<div v-if="showname" class="customer_list" v-for="(item,index) in dataSorce" >
						<div style="width: 80%; overflow: hidden;">
							<div class="second_list_time" v-show="item.name ? true :false" @click="detialjl(item)">
								<text>姓名：{{item.name}}</text> <text style="padding-left: 120rpx;">{{item.position}}</text>
							</div>
							<div class="second_list_time" v-show="item.mobile ? true :false" >
								<div @click="detialjl(item)" >
									<text>手机号码：{{item.mobile}}</text><br>
									<text>办公电话：{{item.officePhone}}</text>
								</div>
							
							</div>
							<div class="second_list_time" v-show="item.crmName ? true :false" @click="detialjl(item)">
								<text><h4><i class="iconfont icon-qian" style="padding-right: 10rpx; color: red;"></i>{{item.crmName}}</h4></text>
							</div>
						</div>
						<div class="second_list_citi" style="margin: auto;">
							 <div style="margin: auto;" @click="phone(item)">
							 	<i class="iconfont icon-dianhua3" style="float: right; font-size: 40px; padding-right: 40rpx; color:#2283e4;"></i>
							 </div>
						</div>
					</div>
					</view>
					
					<!-- 活动 -->
					<div v-if="activaty">
						<activity :dataSors="dataSorce"></activity>
					</div>
					
					<!-- 商机 -->
					<div v-if="business">
						<business v-if="loading" :dataSorc="dataSorce"></business>
					</div>
					
					<!-- 外勤签到 -->
					<div v-if="singin">
						<singinlist :crmType="crmType" :classid="uid" :dataSorc="dataSorce" :name="title"></singinlist>
					</div>
					
					
					<div class="null_title" v-if="dataSorce == ''">
						<div>
							<i class="iconfont icon-empty iconcize"></i>
						</div>
						<div class="null_title_tow">
							没有更多数据
						</div>
					</div>
				</div>
			<div> 
			
			<!-- <button @click="open">打开弹窗</button> -->
			<popus ref="popup" type="top" >
				<div class="stat">
					<div class="second_list " :style="'margin-top:' +rHeight+ 'px;'">
					<div class="second_list_rows" ></div>
				</div>
				</div>
			</popus>
			<!-- 气泡弹窗 -->
			 <chunLei-popups v-model="value" :popData="data" @tapPopup="tapPopup" :x="345" :y="95" placement="top-end">
			 </chunLei-popups>
		</div>
		
		<!-- 活动添加 -->
		<popus ref="active">
			<div :style="alertWidth">
				<activityadd @closes="closes"></activityadd>
			</div>
		</popus>
		
		<!-- 商机添加 -->
		<popus ref="business">
			<div :style="alertWidth">
				<businessadd @close="close"></businessadd>
			</div>
		</popus>
		
		<!-- 拨打电话 -->
		<popus ref="phone">
			<div :style="alertWidth">
				<slrtphone @close="close" :dataSorc="phonedata"></slrtphone>
			</div>
		</popus>
		
		
		<popus ref="alert">
			<alertcenter @row="row" :dataSorc="datasorces" :titles="titles"></alertcenter>
		</popus>
	</view>
</template>

<script>
	import navitop from '@/components/common/navi-top'
	import alertcenter from '@/pages/common/common/alert/searalert'	
	import popus from '@/uni_modules/uni-popup/components/uni-popup/uni-popup'
	import {list,pages,city,detail,activ,pageList,getUserInfo,Searchdetail,collect,collectOut} from '@/common/api/job/jobapi.js'
	import inputgroup from '@/components/common/input-group'
	import activity from '@/pages/common/index/subpage/activety/activity'	// 活动显示
	import activityadd from '@/pages/common/index/subpage/activety/activityadd' // 活动添加
	import businessadd from '@/pages/common/index/subpage/business/businessadd'	// 商机添加
	import business from '@/pages/common/index/subpage/business/business'	// 商机显示
	import secod from '@/pages/common/index/subpage/secod/secodlist'	//  联系记录显示
	import singinlist from '@/pages/common/index/subpage/singin/singin'		// 外勤签到
	import slrtphone from '@/pages/common/common/alert/searalertphone.vue'	// 电话拨打
	import chunLeiPopups from "@/components/chunLei-popups/chunLei-popups";
	export default {
		components: {
			navitop,
			popus,
			inputgroup,
			chunLeiPopups,
			alertcenter,
			activity,
			business,
			activityadd,
			businessadd,
			secod,
			singinlist,
			slrtphone
		},
		data(){
			return {
				data: [{title:'添加',code:'detialadd',icon:'icon-tianjiaadd143'}],
				value: false,
				dataSorce: [],
				rundataSorce: [],
				oneblck: false,
				oneblcks: false,
				rHeight: 0,
				title: '',
				uid: '',
				state: false,
				se_class: '',
				ze_class: '',
				classification : false,
				action_id: '',
				crmType: '',
				showList: false,  // 列表切换
				showListone: false,  // 列表切换	联系记录
				showname: false,	// 联系人
				activaty: false,	// 市场活动切换
				business: false,	// 商机
				singin: false,		// 外勤签到
				
				search: true,		// 隐藏搜索
				searchadd: true,	// 隐藏添加
				sear_alert: 0, 		// 搜索弹窗
				datasorces:[], 		//下拉插件数据	
				datasor:[], 		//下拉插件数据	
				
				alertWidth: '',		// 获取窗口宽度 
				
				value_cli: ''	,//获取分类
				
				titles: '',		// 弹窗标题
				phonedata: ''	,// 拨打电话
				
				no_serarch: true,
				
				power_list: [		// 权限列表
					'crm:clue:add',	// 公海添加
					'crm:potential:add',// 潜在添加
					'crm:deals:add',	// 成交添加
					'crm:business:add',	// 商机添加
					'crm:activity:add',	// 市场活动
					'crm:linkMan:add',	// 联系人添加
					'crm:touch:add',	// 联系记录添加
				],		// 权限列表
				
				power_alert: false,		// 权限弹窗显示
				
				activi_alert:true,		// 活动显示弹窗
				
				options: '',	// 获取url传参
				
				pages: 1,	// 分页
				
				nv_height: '',
				
				Search_prog:[],	// 获取搜索方案列表
				
				search_all_class: 'second_serch_top', // 全部背景样式
				
				search_class: '',	// 列表背景样式
				
				search_id:'',	// 确定背景样式id
				
				search_type: false,
				
				search_data: [],
				
				loading:true,
				
				search_obj: {},
				
				get_option: '',
				
				
			}
		},
		
		onLoad(option) {
			// 获取窗口宽度
			let _this = this;
			this.options = option;
			uni.getSystemInfo({
			    success: function (res) {
					_this.alertWidth = 'width:' + res.windowWidth + 'px;'
			    }
			});
			this.get_option = option;
			this.title = option.name;
			this.uid = option.id;
			this.crmType = option.crmType;
			// 列表
			this.class_list(option,this.pages);
			
			this.alert_data();
			
		},
		
		//上拉加载监听方法
		onReachBottom: function(){
			if(this.dataSorce.length >= 20){
				this.pages++;
				this.class_list(this.options,this.pages)
			}
		},
		
		
		mounted() {
			this.rHeight = uni.getSystemInfoSync().statusBarHeight;
			
			this.nv_height = uni.getSystemInfoSync().statusBarHeight + 50 + 'px';
			
			const res = uni.getSystemInfoSync();
			if(this.crmType !== 'undefined'){
				this.Search_list(this.crmType);
				this.search_type = true;
			}
		},
		
		methods:{
			
			// 取消关注和关注
			collect_on(val){
				uni.showLoading({
					title: '加载中。。。'
				})
				if(val.collectId){
					collectOut([val.id]).then((rows)=>{
						if(rows.code == 200){
							uni.hideLoading();
							uni.showToast({
								title: '已取关！'
							})
							this.dataSorce.filter(function(item){
								if(item.id == val.id){
									item.collectId = false;
								}
							})
						}
					})
				}else {
					collect([val.id]).then((rows)=>{
						if(rows.code == 200){
							uni.hideLoading();
							uni.showToast({
								title: '已关注！'
							})
							this.dataSorce.forEach((item) =>{
								if(item.id == val.id){
									this.$set(item,'collectId',true)
								}
							})
						}
					})
				}
				
				
			},
			
			// 组件重载
			alterww(){
				this.loading = false;
				setTimeout(()=>{
					this.loading = true;
				},100)
			},
			
			// 全部
			search_class_all(val){
				let type = '';
				let crmType = '';
				if(this.crmType == 0 || this.crmType == 1 || this.crmType == 2){
					type = 'crm';
					crmType = this.crmType;
				}
				if(this.crmType == 5){
					type = 'business';
					crmType = '1,2'
				}
				if(this.crmType == 3){
					type = 'linkMan';
					crmType = '1,2'
				}
				if(this.crmType == 4){
					type = 'touch';
					crmType = '1,2'
				} 
				this.search_all_class = 'second_serch_top';
				this.search_class = '';
				list({source: type}).then((rows) => {
					if(rows.code == 200){
						
						this.search_obj = {companyType: "isCustomer",crmType: crmType,customerIds: null,dtos:rows.data,isCollected: false,page: {current: 1, size: 20}}
						pages(this.search_obj).then((rst) => {
							if(rst.code == 200){
								this.dataSorce = rst.data.records;
								this.alterww();
							}
						})
					}
				})
			},
			
			// 列表搜索
			search_clas(val){
				let _this = this;
				let type = '';
				let data_list = [];
				let con_code = '';
				let crmType = '';
				this.search_id = val.id;
				this.search_all_class = '';
				this.search_class = 'second_serch_top';
				if(this.crmType == 0 || this.crmType == 1 || this.crmType == 2){
					type = 'crm';
					crmType = this.crmType;
				}
				if(this.crmType == 5){
					type = 'business';
					crmType = '1,2'
				}
				if(this.crmType == 3){
					type = 'linkMan';
					crmType = '1,2'
				}
				if(this.crmType == 4){
					type = 'touch';
					crmType = '1,2'
				} 
				// console.log(type)
				list({source: type}).then((rows) => { 
					if(rows.code == 200){
						
						
						
						con_code = rows.data
						rows.data.forEach(item => {
							if (item.type == '时间' || item.type == '日期') {
								this.$set(item, 'rangDateVal', JSON.parse(val.searchVal)[item.code])
								if (JSON.parse(val.searchVal)[item.code]) {
									// this.$set(item, 'value', JSON.parse(val.searchVal)[item.code][0])
								}
							} else{
								this.$set(item, 'value', JSON.parse(val.searchVal)[item.code])
							}
						})
						this.search_obj = {companyType: "isCustomer",crmType: crmType,customerIds: null,dtos:rows.data,isCollected: false,page: {current: 1, size: 20}}
						pages(this.search_obj).then((rst) => {
							if(rst.code == 200){
								this.dataSorce = rst.data.records;
								this.alterww();
							}
						})
					}
				})
				
			
				
				
			},
			
			// 获取搜索方案列表
			Search_list(val){
				Searchdetail({searchType: val}).then((rows) => {
					if(rows.code == 200){
						// console.log(rows)
						this.Search_prog = rows.data
					}
				})
			},
			
			// 分类列表加载
			class_list(option,pages){
				if(this.uid == 1){// 成交
					this.classification = true;
					this.action_id = 2;
					this.showListone = true;
					this.paelist(option.id,pages);
					this.user_power(option.id,this.power_list[2]);
				}
				if(this.uid == 2){ // 公海
					this.action_id = 0;
					this.showListone = true;
					this.paelist(option.id,pages);
					this.user_power(option.id,this.power_list[0]);
				}
				if(this.uid == 3){ // 潜在
					this.action_id = 1;
					this.showListone = true;
					this.paelist(option.id,pages); 
					this.user_power(option.id,this.power_list[1]);
				}
				if(this.uid == 4){	// 商机
					this.search = false;    
					this.data = [{title:'添加',code:'businessadd',icon:'icon-tianjiaadd143'}];
					this.busines_list(option.id,pages);
					this.user_power(option.id,this.power_list[3]);
				}
				if(this.uid == 5){	// 活动
					this.search = false; 
					this.activi_alert = false;
					this.data = [{title:'添加',code:'activeadd',icon:'icon-tianjiaadd143'}];
					this.activitys(option.id,pages);
					this.user_power(option.id,this.power_list[4]);
				}
				if(this.uid == 6){ // 联系记录
					this.action_id = 1;
					this.secod_list(option.id,pages);
					this.sear_alert = 1;
					this.titles= '选客户 写跟进记录'
					this.user_power(option.id,this.power_list[6]);
				}
				if(this.uid == 7){ // 联系人
					this.action_id = 1;
					this.showname = true;
					this.search = false;
					this.searchadd = false;
					this.contactlist('linkMan',pages);
					this.sear_alert = 2;
					this.titles= '选客户 添加联系人'
					this.user_power(option.id,this.power_list[5]);
				}
				if(this.uid == 8){ 	// 考勤签到
					this.sear_alert = 3;
					this.activi_alert = false;
					this.titles = '选客户 外勤签到';
					this.activit_list(option.id,pages);
					this.user_power(option.id,this.power_list[6]);
				}
			},
					
			// 下拉刷新
			onPullDownRefresh() {
				let _this = this;
				setTimeout(function () {
					uni.stopPullDownRefresh();
					uni.redirectTo({
						url: '/pages/common/index/second?id=' + _this.uid + '&name=' + _this.title + '&crmType=' + _this.crmType
					});
				}, 1000);
			},
			// 权限控制 (默认)
			user_power(result,code){
				getUserInfo().then((rows) => {
					if(rows.code == 200){
						rows.data.permissions.forEach(item => {
							if(item == code) {
								this.power_alert = true;
							}
						})
					}
				})
			},
			
			// 返回上一页 
			outlot(){
				uni.switchTab({
					url: "/pages/index/index"
				})
			},
			
			// 拨打电话
			phone(val){
				this.phonedata = val;
				this.$refs.phone.open('bottom');
			},
			
			// 底部弹窗
			 open(val) {
				 this.datasorces = val;
			     this.$refs.alert.open('bottom');
			},
			
			searAlert(){
				this.datasorces.forEach(item => {
					this.$set(item,'name',item.crmName)
				})
				// this.data = this.datasorces
				this.$refs.alert.open('bottom');
			},
			
			// 获取市场活动
			activitys(uids,page){
				uni.showLoading({
					title: "加载中..."
				})
				activ({current: page,size: 20}).then((val) => {
					if(val.code == 200){
						uni.hideLoading();
						this.activaty = true;
						if(!val.data.records.length){
							uni.showToast({
								title: '没有更多了',
								icon: 'error'
							}) 
						}
						if(this.dataSorce){
							for(let i in val.data.records){
								this.dataSorce.push(val.data.records[i])
							}
						}else{
							this.dataSorce = val.data.records;
						}
					}
				})
			},
			
			// 获取商机列表
			busines_list(uids,pag){
				uni.showLoading({
					title: "加载中..."
				})
				if(uni.getStorageSync('search') !== ''){
					uni.hideLoading();
					this.business = true;
					this.runDataSorce = uni.getStorageSync('search')
					uni.removeStorageSync('search'); 
				}else {
					list({source: 'business'}).then((result) => {
						if(result.code == 200){
							pages({crmType: '1,2',customerIds: null,dtos:result.data,isCollected: false,page:{current: pag, size: 20}}).then((val) => {
								if(val.code == 200){
									this.runDataSorce = val.data.records
									this.business = true;
									uni.hideLoading();
									if(!val.data.records.length){
										uni.showToast({
											title: '没有更多了',
											icon: 'error'
										}) 
									}
									if(this.dataSorce){
										for(let i in val.data.records){
											this.dataSorce.push(val.data.records[i])
										}
									}else{ 
										this.dataSorce = val.data.records;
									}
								}
							})
						}
					})
				}
			},
			
			// 获取跟进记录列表
			secod_list(uids,pag){
				let _this = this;
				let runDate = [];
				uni.showLoading({
					title: '加载中...'
				})
				if(uni.getStorageSync('search') !== ''){
					uni.hideLoading();
					this.dataSorce = uni.getStorageSync('search');
					this.showList = true;
					uni.removeStorageSync('search'); 
				}else{
					list({source: 'touch'}).then((rows) => {
						if(rows.code == 200){
							pages({crmType: "1,2",dtos: rows.data,isCollected: false,page: {current: 1, size: 20},type: "touch"}).then((val) => {
							if(val.code == 200){
								uni.hideLoading();
								this.showList = true;
								if(!val.data.records.length){
									uni.showToast({
										title: '没有更多了',
										icon: 'error'
									}) 
								}
								if(this.dataSorce){
									for(let i in val.data.records){
										this.dataSorce.push(val.data.records[i])
									}
								}else{
									this.dataSorce = val.data.records;
								}
								
								// 区分(会话/签到)
								// this.dataSorce.filter(function(item){
								// 	if(item.type == 1){
								// 		runDate.push(item)
								// 	}
								// })
								// this.dataSorce = runDate;
							}
							})
						}
					})
					
					
				}
			},
			
			contactlis(val){
				pageList().then((rows)=>{
					if(rows.code == 200){
						this.dataSorce = rows.data.records
					}
				})
			},
			
			// 获取 客户数据
			alert_data(){
				let sun = [];
				list({'source': 'crm'}).then((row) => {
					if(row.code == 200){
					pages({'dtos':row.data,'crmType': '1','customerIds':'','isCollected':false,page: {current: 1, size: 20}}).then((val) => {
						if(val.code == 200){
							this.datasor = val.data.records
							pages({'dtos':row.data,'crmType': '2','customerIds':'','isCollected':false,page: {current: 1, size: 20}}).then((vals) => {
								if(val.code == 200){
									sun = vals.data.records;
									this.datasorces = this.datasor.concat(sun);
								}
							})
						}
					})
					}
				})
			},
			
			
			// 获取下拉弹窗数据
			row(val){
				detail({id:val.id}).then((rows) => {
					if(rows.code == 200){
						if(	this.sear_alert == 1){
							uni.navigateTo({
								url: '/pages/common/index/recordadd?id=' + rows.data.id +'&crmType=' + this.action_id + '&classid=' + this.uid + '&name=' + this.title  + '&index=' + 2 + '&names=' + rows.data.crmName
							})
						}
						if(this.sear_alert == 2){
							uni.navigateTo({
								url: '/pages/common/index/contactadd?id=' + rows.data.id +'&crmType=' + this.action_id + '&classid=' + this.uid + '&name=' + this.title  + '&index=' + 1 + '&names=' + rows.data.crmName
							})
						}
						if(this.sear_alert == 3){
							uni.navigateTo({
								url: '/pages/common/index/recordadd?id=' + rows.data.id +'&crmType=' + this.action_id + '&classid=' + this.uid + '&name=' + this.title  + '&index=' + 2 + '&names=' + rows.data.crmName + '&stal=1'
							})
						}
					}
				})
			},
			
			
			// 关闭添加窗口(活动)
			closes(val){
				if(val == 1){
					location.reload();
					this.$refs.active.close();
				}else{
					this.$refs.active.close();
				}
			},
			
			close(val){
				if(val == 1){
					location.reload();
					this.$refs.business.close();
				}else{
					this.$refs.business.close();
				}
			},
			
			// 添加客户
			tapPopup(val){
				console.log(val)
				this.value = true;
				if(val.code == 'detialadd')
				{
					uni.navigateTo({
						url: "/pages/common/index/detialadd?crmType=" + this.crmType + '&name=' + this.title +'&id=' +this.uid
					})
				}
				if(val.code == 'activeadd'){
					this.$refs.active.open('right')
				}
				if(val.code == 'businessadd'){
					this.$refs.business.open('right')
				}
			},
			// 搜索
			switchs(val){
				if(val == 1){
					uni.navigateTo({
						url: "/pages/common/common/serarch/search?crmType=" + this.crmType + '&name=' + this.title + '&id='	+ this.uid
					})
				}else if(val == 2){
					if(this.se_class != ''){
						this.oneblck = false;
						this.oneblcks = false;
						this.se_class = "";
					}else {
						this.oneblck = true;
						this.oneblcks = false;
						this.se_class = "se_switch_click";
					}
				}
			},
			oushow(val){
					this.oneblcks = false;
					this.oneblck = false;
					this.se_class = "";
			},
			
			// 获取列表 公海/成交/潜在
			paelist(id,datas){
				let _this = this;
				// this.dataSorce = [];
				uni.showLoading({
					title: '加载中...'
				})
				if(uni.getStorageSync('search') !== ''){
						uni.hideLoading();
						this.dataSorce = uni.getStorageSync('search');
						uni.removeStorageSync('search'); 
					}else{
					list({'source': 'crm'}).then((row) => {
						if(row.code == 200){
						pages({'companyType': "isCustomer",'dtos':row.data,'crmType': this.action_id,'customerIds':'','isCollected':false,page: {current: datas, size: 20}}).then((val) => {
							if(id == 3 || id == 1 || id == 2){  
								uni.hideLoading();
								if(!val.data.records.length){
									uni.showToast({
										title: '没有更多了',
										icon: 'error'
									}) 
								}
								if(val.data.records.length){
									val.data.records.filter((item) => {
											_this.dataSorce.push(item)
									})
								}
							}
						})
						}
					})
				}
			},
			
			
			// 获取联系人列表 
			contactlist(val,pag){
				uni.showLoading({
					title: '加载中...'
				})
				if(uni.getStorageSync('search') !== ''){
					uni.hideLoading();
					this.dataSorce = uni.getStorageSync('search')
					uni.removeStorageSync('search'); 
				}else {
					list({source: val}).then((rows)=>{
						if(rows.code == 200){
							pages({'dtos':rows.data,'crmType': this.action_id,'customerIds':'','isCollected':false,page: {current: pag, size: 20},'type': val}).then((result) => {
								if(result.code == 200){
									uni.hideLoading();
									if(!result.data.records.length){
										uni.showToast({
											title: '没有更多了',
											icon: 'error'
										}) 
									}
									if(this.dataSorce){
										for(let i in result.data.records){
											this.dataSorce.push(result.data.records[i])
										}
									}else{
										this.dataSorce = result.data.records;
									}
								}
							})
						}
					})
				}
			},
			
			// 客户/公海/潜在 跳转
			detials(val){
				uni.navigateTo({
					url: '/pages/common/index/detial?id=' + val +'&crmType=' + this.action_id + '&classid=' + this.uid + '&name=' + this.title + '&index=' + 0
				})
			},
			// 联系记录跳转
			detia(val){
				detail({id:val.crmId}).then((rows) => {
					if(rows.code == 200){
						uni.navigateTo({
							url: '/pages/common/index/detial?id=' + val.crmId +'&crmType=' + rows.data.crmType + '&classid=' + this.uid + '&name=' + this.title  + '&index=' + 2 + '&LcrmType=' + this.crmType
						})
					}
				})
			},
			// 联系人
			detialjl(val){
				uni.navigateTo({
					url: '/pages/common/index/detial?id=' + val.crmId +'&crmType=' + this.action_id + '&classid=' + this.uid + '&name=' + this.title  + '&index=' + 1 + '&LcrmType=' + this.crmType
				})
			}
		}
		
	}
</script>

<style scoped lang="scss">
.second {
	height: 80rpx;
	line-height: 80rpx;
	border-top: 1px solid #cacaca;
	// border-bottom: 1px solid #cacaca;
	.second-outside {
		display: flex;
		justify-content: space-between;
		width: 95%;
		margin: auto;
	}
	
}
// 头部切换
.second_serch {
	height: 90rpx;
	line-height: 90rpx;
	background-color: #fff;
	margin-bottom: 10px;
	padding: 0 10px 0 10px;
	display: flex;
	// justify-content: space-between;
	white-space: nowrap;
	overflow-x: scroll;
	overflow-y: hidden;
	div {
		padding:  0 40rpx 0 40rpx;
	}
}

//头部切换样式背景
.second_serch_top{
	background-color: rgb(34, 131, 228);
	color:#fff;
}


.se_switch {
	height: 90rpx;
	background-color: #fff;
	display:flex;
	margin-bottom: 10rpx;
	justify-content: space-between;
	div {
		width: 180rpx;
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
	}
}
.se_switch_click{
	border-bottom: 2px solid #1296db;
}

 // 加号弹窗
.second_list_title {
	height: 80rpx;
	width: 100%;
	display: flex;
	justify-content: space-between;
}
.second_row {
	background-color: #fff;
	margin: auto;
	height: 80rpx;
	line-height: 80rpx;
	width:98%;
	text-align: center;
}

// 弹窗列表
.second_list {
	height: 80rpx;
	width: 100%;
	// background-color: #fff;
	.second_list_rows {
		line-height: 80rpx;
		margin: auto;
		background-color: #fff;
		padding-left: 20rpx;
		text-align: center;
		border-bottom: 1px solid #C8C7CC;
	}
}
.stat{
		background-color: #fff;
		position: fixed;
		z-index: 1;
		height: var(--status-bar-height);// --status-bar-height系统状态栏高度
		width: 100%;
		top: 0;
		left: 0;
	}

//页面列表
.second_list_solt {
	width: 100%;
	.second_list_row div{
		padding: 5rpx 0 5rpx 0;
	}
	.second_list_row{
		width: 95%;
		padding-top: 5px;
		padding-left: 40rpx;
		margin:auto;
		.second_list_name {
			font-size: 16px;
		}
		.second_list_time{
			font-size: 16px;
			// color: #808080;
		}
		.second_list_citi {
			padding-bottom: 10rpx;
			border-bottom: 1px solid #C8C7CC;
			font-size: 12px;
			color: #2b83e2;
		}
			.second_list_citi text {
				background-color: #97e6f8;
				opacity: 0.5;
				border-radius: 4px;
				padding: 5rpx 20rpx 5rpx 20rpx;
			}
	}
}	

.customer_list {
	display: flex;
	.collect_left {
		width: 80%;
		overflow: hidden;
	}
	.collect_right {
		height: 100%;
		margin: auto;
		color: #939393;
	}
	.collect_right_c {
		height: 100%;
		margin: auto;
		color: #ff9900;
	}
}
.collect_not {
	color: red;
}
.second_fliex{
	position: fixed;
	width: 100%;
	top: 0;
}
</style>
